home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windows 95 API Bible
/
Windows 95 API Bible 3 Disc Set.iso
/
Win32 API Bible Book 1 of 3
/
CHAPTE21
/
EX17.C
< prev
next >
Wrap
C/C++ Source or Header
|
1995-05-28
|
2KB
|
55 lines
#include <genstub.c>
LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch (uMsg)
{
case WM_COMMAND:
switch ( LOWORD( wParam ) )
{
case IDM_TEST:
{
char szBuffer[128];
SYSTEMTIME stUniversalTime;
SYSTEMTIME stLocalTime;
TIME_ZONE_INFORMATION tz;
GetTimeZoneInformation( &tz );
wsprintf( szBuffer,
"Bias: %ld, Name: %s, Day: %d, Month: %d, Year: %d",
tz.Bias + tz.StandardBias, tz.StandardName,
tz.StandardDate.wDay,
tz.StandardDate.wMonth,
tz.StandardDate.wYear );
MessageBox( hWnd, szBuffer, "Standard Date", MB_OK );
wsprintf( szBuffer,
"Bias: %ld, Name: %s, Day: %d, Month: %d, Year: %d",
tz.Bias + tz.DaylightBias, tz.DaylightName,
tz.DaylightDate.wDay,
tz.DaylightDate.wMonth,
tz.DaylightDate.wYear );
MessageBox( hWnd, szBuffer, "Daylight Date", MB_OK );
GetSystemTime( &stUniversalTime );
SystemTimeToTzSpecificLocalTime( &tz, &stUniversalTime,
&stLocalTime );
wsprintf( szBuffer, "Hour: %d, Minute: %d, Second: %d",
stLocalTime.wHour, stLocalTime.wMinute,
stLocalTIme.wSecond );
MessageBox( hWnd, szBuffer, "Converted Time", MB_OK );
break;
}
case IDM_EXIT:
DestroyWindow( hWnd );
break;
}
break;
}
break;
case WM_DESTROY:
PostQuitMessage( 0 );
break;
default:
return (DefWindowProc(hWnd, uMsg, wParam, lParam));
}
return (NULL);
}